<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http:www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<include file="./Home/Tpl/Admin/Common/cssjs.html" />
</head>
<body>
<style type="text/css">
	html{_overflow-y:scroll}
</style>
<link href="{$Config.siteurl}statics/js/swfupload/swfupload.css" rel="stylesheet" type="text/css" />
<form name="myform" action="{:U("Attachments/album_load")}" method="get" >
  <input type="hidden" value="Attachment" name="g">
  <input type="hidden" value="Attachments" name="m">
  <input type="hidden" value="album_load" name="a">
  <div class="lh26" style="padding:10px 0 0">
    <label>名称</label>
    <input type="text" value="{$Think.get.filename}" class="input-text" name="filename">
    <label>日期</label>
    <link rel="stylesheet" type="text/css" href="{$Config.siteurl}statics/js/calendar/jscal2.css"/>
    <link rel="stylesheet" type="text/css" href="{$Config.siteurl}statics/js/calendar/border-radius.css"/>
    <link rel="stylesheet" type="text/css" href="{$Config.siteurl}statics/js/calendar/win2k.css"/>
    <script type="text/javascript" src="{$Config.siteurl}statics/js/calendar/calendar.js"></script> 
    <script type="text/javascript" src="{$Config.siteurl}statics/js/calendar/lang/en.js"></script>
    <input type="text" name="uploadtime" id="uploadtime" value="{$Think.get.uploadtime}" size="10" class="date" readonly>
    <script type="text/javascript">
			Calendar.setup({
			weekNumbers: true,
		    inputField : "uploadtime",
		    trigger    : "uploadtime",
		    dateFormat: "%Y-%m-%d",
		    showTime: false,
		    minuteStep: 1,
		    onSelect   : function() {this.hide();}
			});
        </script>
    <input type="submit" value="搜索" class="button" name="dosubmit">
  </div>
</form>
<div class="bk20 hr"></div>
<ul class="attachment-list"  id="fsUploadProgress">
<volist name="data" id="vo">
  <li>
    <div class="img-wrap"> <a href="javascript:;" onclick="javascript:album_cancel(this,'{$vo.aid}','{$vo.filepath}')" title="{$vo.filename}">
      <div class="icon"></div>
      <img src="{$vo.filepath}" width="80" path="{$vo.filepath}" title="{$vo.filename}"/></a> </div>
  </li>
</volist> 
</ul>
<div id="pages" class="text-c">{$Page}</div>
<script type="text/javascript">
$(document).ready(function(){
	set_status_empty();
});	
function set_status_empty(){
	parent.window.$('#att-status').html('');
	parent.window.$('#att-name').html('');
}
function album_cancel(obj,id,source){
	var src = $(obj).children("img").attr("path");
	var filename = $(obj).children("img").attr("title");
	if($(obj).hasClass('on')){
		$(obj).removeClass("on");
		var imgstr = parent.window.$("#att-status").html();
		var length = $("a[class='on']").children("img").length;
		var strs = filenames = '';
		$.get('index.php?a=swfupload_json_del&m=Attachments&g=Attachment&aid='+id+'&src='+source+'&filename='+filename);
		for(var i=0;i<length;i++){
			strs += '|'+$("a[class='on']").children("img").eq(i).attr('path');
			filenames += '|'+$("a[class='on']").children("img").eq(i).attr('title');
		}
		parent.window.$('#att-status').html(strs);
		parent.window.$('#att-name').html(filenames);
	} else {
		var num = parent.window.$('#att-status').html().split('|').length;
		var file_upload_limit = '{$file_upload_limit}';
		if(num > file_upload_limit) {alert('不能选择超过'+file_upload_limit+'个附件'); return false;}
		$(obj).addClass("on");
		$.get('index.php?a=swfupload_json&m=Attachments&g=Attachment&aid='+id+'&src='+source+'&filename='+filename);
		parent.window.$('#att-status').append('|'+src);
		parent.window.$('#att-name').append('|'+filename);
	}
}
</script>
</body>
</html>